const md = require('../../utils/md5.js');
const app = getApp();
const post = require('../../utils/post.js');
var util = require('../../utils/util.js');
Page({

  /**
   * 页面的初始数据
   */
  data: {
    doubleLineCanvasData: {
      canvasId: 'doubleLine',
    },
    doubleLineTitle: "资产统计",
    doubleLineUnit: [
      { color: "#F0B071", title: "资金结余5200.00元" },
      { color: "#FFA848", title: "存货结余41500.00元" }
    ],
    columnCanvasData: {
      canvasId: 'columnCanvas',
    },
    columnCanvasData2: {
      canvasId: 'columnCanvas',
    },
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },
  onShow:function(){
    var that = this;
    var depid = wx.getStorageSync('depid')
    var userinfo = wx.getStorageSync('userinfo')
    that.setData({
      userinfo:userinfo,
      depid: depid,
      mebid: userinfo.MebID
    });
    // that.getapply(userinfo.MebID)
    if (depid) {
      that.getalldata(depid);
    }
    // 获取成员信息
    // var datas = {};
    // var phone = (wx.getStorageSync('phone'));
    // datas.where = 'Tel =' + phone;
    // var datacall = function (res) {
    //   if (res.data.data.length != 0) {
    //     wx.setStorageSync('userinfo', res.data.data[0]);
    //     var depid = wx.getStorageSync('depid')
    //     that.setData({
    //       userinfo: wx.getStorageSync('userinfo'),
    //       depid:depid
    //     });
    //     that.getapply(res.data.data[0].MebID)
    //     if(depid){
    //       that.getalldata(depid);
    //     }
       
    //   }
    // }
    // var res2 = post.getdata("/BO/BA_Member/Query", datas, datacall);
  },
  getapply: function (mebid) {
    var that = this;
    var depid = wx.getStorageSync('depid');
    if (mebid) {
      var apinameIsMeb = "/BO/AP_ShopMembers/Query";
      var timestamp = new Date().getTime();
      timestamp = parseInt(timestamp / 1000);
      var md5IsMeb = md.hexMD5(app.server.appid + timestamp + apinameIsMeb + app.server.appkey);
      wx.request({
        //后台接口地址
        url: app.server.url + apinameIsMeb,
        data: {
          sign: md5IsMeb,
          appid: app.server.appid,
          tmsp: timestamp,
          where: "DepID =" + depid +" and MebID ="+mebid
        },
        method: 'POST',
        header: { 'content-type': 'application/x-www-form-urlencoded' },
        success: function (res) {
          console.log(res);
          if (res.data.data.length > 0) {
            wx.setStorageSync('newinfo', res.data.data[0]);
           // var star = res.data.data[0].StarLevel ? res.data.data[0].StarLevel : "";
            that.setData({
              newinfo: res.data.data[0],
            })
            if (res.data.data[0].MebID != res.data.data[0].MasterMebID) {
              wx.showModal({
                title: '',
                content: '非主账号不能进行提现！',
              })
              return;
            }
            wx.navigateTo({
              url: '/pages/withdrawals/withdrawals',
            })
          }else{
            wx.showModal({
              title: '',
              content: '您还没有门店，无法使用提现功能',
            })
            return;
          }
        }
      })
    }
  },
  tosavedecribe() {
    wx.navigateTo({
      url: '/pages/savedecribe/savedecribe',
    })
  },
  getalldata: function (depid) {
    var that = this;
    // 获取成员信息
    var datas = {};
    datas.DepID = depid;
    var datacall = function (res) {
      console.log(res);
      if (res.data.data.length != 0) {
        var daymoney = res.data.data.DaySumRpt;
        var zhoubao = res.data.data.AccSumRpt;
        var maxmoney = 0;
        var minmoney = daymoney[0].Balance;
        var maxgoods = 0;
        var mingoods = daymoney[0].goods;
        var data1 = [];
        var data2 = [];
        var sevendaty = [];
        var ttt = {};
        var day = [];
        var datazijin=[];
        var datajieyu=[];
        var daysarr=[];
        for (var i = 0; i < daymoney.length; i++) {
          if (maxmoney < daymoney[i].Balance) {
            maxmoney = daymoney[i].Balance
          }
          if (minmoney > daymoney[i].Balance) {
            minmoney = daymoney[i].Balance
          }
          if (maxgoods < daymoney[i].Goods) {
            maxgoods = daymoney[i].Goods
          }
          if (mingoods > daymoney[i].Goods) {
            mingoods = daymoney[i].Goods
          }
          day = daymoney[i].AccDate.split(' ');
          day = day[0].split('-');
          // ttt.x = daymoney.length - i - 1;
          // ttt.y = daymoney[i].Balance;
          // ttt.title = day[1] + "." + day[2] + "|资金结余" + daymoney[i].Balance + "|存货结余" + daymoney[i].Goods;
          // data1[daymoney.length - i - 1] = ttt;
          // ttt = {};
          // ttt.x = daymoney.length - i - 1;
          // ttt.y = daymoney[i].Goods;
          // ttt.title = "";
          // data2[daymoney.length - i - 1] = ttt;
          // ttt = {};
          // ttt.x = daymoney.length - i - 1;
          // ttt.y = 0;
          // ttt.title = day[1] + "." + day[2];
          // sevendaty[daymoney.length - i - 1] = ttt;
          // ttt = {};
          daysarr[daymoney.length - i - 1] = day[1] + "." + day[2];
          day = [];   
        }
        var zhouarr = [];
        var sign = '';
        for (var j = 0; j < zhoubao.length; j++) {
          zhouarr[j] = zhoubao[zhoubao.length - j - 1];
        }
        var kedu1 = Math.ceil((maxmoney / 3) / 100) * 100;
        var kedu2 = Math.ceil((maxgoods / 3) / 100) * 100;

        var bili1 = 60 / (kedu1*3);
    
        var bili2 = 60 / (kedu2 * 3);
        var ydata1 = [];
        var ydata2 = [];
        var bbb = {};//装载数据的盒子
        var ccc ={};
        for (var i = 0; i < 4; i++) {
          bbb.x = 0;
          bbb.y = i * 20;
          bbb.title = i * kedu1;
          ydata1[i] = bbb;
          bbb = {};
          ccc.x = 0;
          ccc.y = i * 20;
          ccc.title = i * kedu2;
          ydata2[i] = ccc;
          ccc = {};
        };
        for (var i = 0; i < daymoney.length; i++){
          datazijin[i] = (daymoney[daymoney.length - i - 1].Balance) * bili1;  
          datajieyu[i] = (daymoney[daymoney.length - i - 1].Goods) * bili2;
        }
        that.setData({
          mmx: maxmoney,
          mmg:maxgoods,
          backmoney: post.toDecimal2(res.data.data.BackMnySum),
          jieyumoney: res.data.data.ProfitRate,
          leijimoney: post.toDecimal2(res.data.data.ProfitSum),
          zhouarr: zhouarr,
          doubleLineUnit: [
            { color: "#F0B071", title: "资金结余" + daymoney[0].Balance + "元" },
            { color: "#CA1515", title: "存货结余" + daymoney[0].Goods + "元" }
          ],
          todaymoney: post.toDecimal2(res.data.data.LastProfit),
        })
        // that.getzhexian(data1, data2, sevendaty, maxmoney, 0, maxgoods, mingoods);
         console.log(datazijin)
         var mmm1 = daymoney[0].Balance ? daymoney[0].Balance:"0.00";
         var mmm2 = daymoney[0].Goods ? daymoney[0].Goods:"0.00";
         that.showzhuxing(mmm1);
        that.showzhuxing2(daysarr, ydata1, datazijin);
        that.showzhuxings(mmm2);
        that.showzhuxings2(daysarr, ydata2, datajieyu);
      }
    }
    var res2 = post.getdata("/Action/PK01/GetAsset7DaySumRpt", datas, datacall);
  },
  //双折线图配置参数
  getzhexian: function (data1, data2, sevendaty, maxm, minm, maxg, ming) {
    var rate = 0;
    var doubleLineCanvasWidth = 0;
    var doubleLineCanvasHeight = 0;
    var that = this;
    var systemInfo = app.systemInfo;
    rate = systemInfo.screenWidth / 750;
    var updateData = {};

    doubleLineCanvasWidth = systemInfo.screenWidth - rate * 64 -20;
    doubleLineCanvasHeight = rate * 304 + rate * 20 + rate * 32 + rate * 24; //轴高+内外边距+字体大小
    var doubleLineYMax = Math.ceil(maxm / 1000) * 1000;
    var doubleLineYMin = minm;
    var doubleLineXMax = 0;
    var doubleLineXMin = 0;
    updateData['doubleLineCanvasData.canvasWidth'] = doubleLineCanvasWidth;
    updateData['doubleLineCanvasData.axisPadd'] = { left: rate * 10, top: rate * 20, right: rate * 10 };
    updateData['doubleLineCanvasData.axisMargin'] = { bottom: rate * 32, left: rate * 20, right: rate * 20 };
    updateData['doubleLineCanvasData.yAxis.fontSize'] = rate * 22;
    updateData['doubleLineCanvasData.yAxis.fontColor'] = '#637280';
    updateData['doubleLineCanvasData.yAxis.lineColor'] = '#DCE0E6';
    updateData['doubleLineCanvasData.yAxis.lineWidth'] = rate * 2;
    updateData['doubleLineCanvasData.yAxis.dataWidth'] = rate * 68;
    updateData['doubleLineCanvasData.yAxis.isShow'] = true;
    updateData['doubleLineCanvasData.yAxis.isDash'] = true;
    updateData['doubleLineCanvasData.yAxis.minData'] = doubleLineYMin;
    updateData['doubleLineCanvasData.yAxis.maxData'] = doubleLineYMax;
    updateData['doubleLineCanvasData.yAxis.padd'] = rate * 304 / (doubleLineYMax - doubleLineYMin);

    updateData['doubleLineCanvasData.xAxis.dataHeight'] = rate * 26;
    updateData['doubleLineCanvasData.xAxis.fontSize'] = rate * 24;
    updateData['doubleLineCanvasData.xAxis.fontColor'] = '#637280';
    updateData['doubleLineCanvasData.xAxis.lineColor'] = '#DCE0E6';
    updateData['doubleLineCanvasData.xAxis.lineWidth'] = rate * 2;
    updateData['doubleLineCanvasData.xAxis.minData'] = doubleLineXMin;
    updateData['doubleLineCanvasData.xAxis.maxData'] = doubleLineXMax;
    updateData['doubleLineCanvasData.xAxis.padd'] = (doubleLineCanvasWidth - rate * (10 + 10 + 20 + 20 + 68 + 68)) / (doubleLineXMax - doubleLineXMin); //画布宽度减去内外边距

    updateData['doubleLineCanvasData.canvasHeight'] = doubleLineCanvasHeight;
    updateData['doubleLineCanvasData.touchDetail.width'] = rate * 144;
    updateData['doubleLineCanvasData.touchDetail.height'] = rate * 149;
    updateData['doubleLineCanvasData.touchDetail.fontSize'] = rate * 20;
    updateData['doubleLineCanvasData.touchDetail.fontColor'] = '#ffffff';
    updateData['doubleLineCanvasData.touchDetail.padd'] = rate * 12;
    updateData['doubleLineCanvasData.touchDetail.bgColor'] = "#637280";
    updateData['doubleLineCanvasData.touchDetail.lineSpacingExtra'] = rate * 12;


    let doubleLineRightYAxisData = [];
    let doubleLineRightYMax = Math.ceil(maxg / 1000) * 1000;
    let doubleLineRightYMin = 0;
    let lineDoubleRatio = 1;
    let changeRate = doubleLineYMax / doubleLineRightYMax;
    for (var i = 0; i < data2.length; i++) {
      data2[i].y = data2[i].y * changeRate;
    }

    let doubleLineSeries = {
      data: [{
        data: data1
        // [
        //   { x: 0, y: 100, title: "4月4日|展现量10000|点击量:1000|点击率:10%" },
        //   { x: 1, y: 230, title: "4月5日|展现量:10000|点击量:1000|点击率:10%" },
        //   { x: 2, y: 430, title: "4月6日|展现量:10000|点击量:1000|点击率:10%" },
        //   { x: 3, y: 530, title: "4月7日|展现量:10000|点击量:1000|点击率:10%" },
        //   { x: 4, y: 630, title: "4月8日|展现量:10000|点击量:1000|点击率:10%" },
        //   { x: 5, y: 730, title: "4月9日|展现量:10000|点击量:1000|点击率:10%" },
        //   { x: 6, y: 830, title: "4月10日|展现量:10000|点击量:1000|点击率:10%" }
        // ]
        ,
        lineColor: "#F0B071",
        point: {
          size: rate * 5,
          bColor: '#F0B071',
          sClor: '#ffffff',
          isShow: true
        }
      }, {
        data: data2
        // [
        //   { x: 0, y: 90, title: "" },
        //   { x: 1, y: 130, title: "" },
        //   { x: 2, y: 430, title: "" },
        //   { x: 3, y: 530, title: "" },
        //   { x: 4, y: 130, title: "" },
        //   { x: 5, y: 130, title: "" },
        //   { x: 6, y: 830, title: "" }
        // ]
        ,
        lineColor: "#CA1515",
        point: {
          size: rate * 5,
          bColor: '#CA1515',
          sClor: '#ffffff',
          isShow: true
        }
      }]
    };
    let doubleLineXAxisData = sevendaty
    // [
    //   { x: 0, y: 0, title: "04.4" },
    //   { x: 1, y: 0, title: "04.5" },
    //   { x: 2, y: 0, title: "04.6" },
    //   { x: 3, y: 0, title: "04.7" },
    //   { x: 4, y: 0, title: "04.8" },
    //   { x: 5, y: 0, title: "04.9" },
    //   { x: 6, y: 0, title: "04.10" }
    // ]

    let doubleLineYAxisData = [];

    doubleLineXMax = 6;
    //doubleLineYMax = that.getYMax(doubleLineYMax);
    doubleLineYAxisData = that.getYAxiss(doubleLineYMax);

    lineDoubleRatio = doubleLineYMax / doubleLineRightYMax;
    doubleLineRightYAxisData = that.getRightYAxiss(doubleLineRightYMax, lineDoubleRatio);

    updateData['doubleLineCanvasData.xAxis.minData'] = doubleLineXMin;
    updateData['doubleLineCanvasData.xAxis.maxData'] = doubleLineXMax;
    updateData['doubleLineCanvasData.xAxis.padd'] = (doubleLineCanvasWidth - rate * (10 + 10 + 20 + 20 + 68 + 68)) / (doubleLineXMax - doubleLineXMin); //画布宽度减去内外边距
    updateData['doubleLineCanvasData.yAxis.minData'] = doubleLineYMin;
    updateData['doubleLineCanvasData.yAxis.maxData'] = doubleLineYMax;
    updateData['doubleLineCanvasData.yAxis.padd'] = rate * 304 / (doubleLineYMax - doubleLineYMin);
    updateData['doubleLineCanvasData.series'] = doubleLineSeries;
    updateData['doubleLineCanvasData.xAxis.data'] = doubleLineXAxisData;
    updateData['doubleLineCanvasData.yAxis.data'] = doubleLineYAxisData;
    updateData['doubleLineCanvasData.yAxis.rightData'] = doubleLineRightYAxisData;
    updateData['doubleLineCanvasData.yAxis.rightData'] = doubleLineRightYAxisData;

    that.setData(updateData);
  },
  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
      * 获得y轴最大值
      * @param  {[type]} yMax 当前最大值
      * @return {[type]}      [description]
      */
  getYMax: function (yMax) {
    var scount = 4;
    let maxInt = Math.floor(yMax);
    let maxLength = maxInt.toString().length;
    let interval = 0;
    if (maxInt == 0) {
      interval = scount * Math.pow(10, 1);
    } else {
      if (maxLength > scount) {
        interval = scount * Math.pow(10, maxLength - 2);
      } else {
        interval = scount * Math.pow(10, maxLength - 1);
      }
    }
    let remainder = maxInt % interval;
    let conversionMax = ((maxInt - remainder) / interval + 1) * interval;
    return conversionMax;
  },

  /**
   * 获得y轴数组
   * @param  {[type]} yMax y轴最大值
   * @return {[type]}      [description]
   */
  getYAxiss: function (yMax) {
    let yAxisData = [];
    let avg = yMax / 4;

    for (var i = 0; i < 5; i++) {
      var point = {};
      point.x = 0;
      point.y = Math.floor(avg) * i;
      point.title = Math.floor(avg) * i;
      yAxisData.push(point);
    }
    return yAxisData;
  },

  /**
   * 获得y轴数组
   * @param  {[type]} yMax y轴最大值
   * @return {[type]}      [description]
   */
  getRightYAxiss: function (yMax, ratio) {
    let yAxisData = [];
    let avg = yMax / 4;

    let point = {};
    point.x = 0;
    point.y = 0 * Math.floor(avg) * ratio;
    point.title = Math.floor(avg) * 0;
    yAxisData.push(point);

    let point1 = {};
    point1.x = 0;
    point1.y = 1 * Math.floor(avg) * ratio;
    point1.title = Math.floor(avg) * 1;
    yAxisData.push(point1);

    let point2 = {};
    point2.x = 0;
    point2.y = 2 * Math.floor(avg) * ratio;
    point2.title = Math.floor(avg) * 2;
    yAxisData.push(point2);

    let point3 = {};
    point3.x = 0;
    point3.y = 3 * Math.floor(avg) * ratio;
    point3.title = Math.floor(avg) * 3;
    yAxisData.push(point3);

    let point4 = {};
    point4.x = 0;
    point4.y = 4 * Math.floor(avg) * ratio;
    point4.title = Math.floor(avg) * 4;
    yAxisData.push(point4);
    return yAxisData;

    // for (var i = 0; i < 5; i++) {
    //   var point = {};
    //   point.x = 0;
    //   point.y = i * Math.floor(avg) * ratio;
    //   point.title = Math.floor(avg) * i;
    //   yAxisData.push(point);
    // }
    // return yAxisData;
  },

  tixian: function () {
    // var info = this.data.newinfo;
    var mebid = this.data.mebid;
    console.log(mebid);
    this.getapply(mebid)
    // if(!info){
    //   wx.showModal({
    //     title: '',
    //     content: '您还没有门店，无法使用提现功能',
    //   })
    //   return;
    // }
    // if (info.MebID != info.MasterMebID){
    //   wx.showModal({
    //     title: '',
    //     content: '非主账号不能进行提现！',
    //   })
    //   return;
    // }
    // wx.navigateTo({
    //   url: '/pages/withdrawals/withdrawals',
    // })
  },
  tocaigou: function () {
    var that = this;
    var money = 0.00;
    if (this.data.backmoney) {
      money = this.data.backmoney;
    }
    wx.navigateTo({
      url: '/pages/showdetail/showdetail?type=caigou&mebid=' + that.data.depid + '&money=' + money,
    })
  },
  tohuibao: function () {
    var money = 0.00;
    if (this.data.jieyumoney) {
      money = this.data.jieyumoney;
    }
    wx.navigateTo({
      url: '/pages/showdetail/showdetail?type=huibao&mebid=' + this.data.depid + '&money=' + money,
    })
  },
  toleiji: function () {
    var money=0.00;
    if (this.data.leijimoney){
      money = this.data.leijimoney;
    }
    wx.navigateTo({
      url: '/pages/showdetail/showdetail?type=leiji&mebid=' + this.data.depid + '&money=' + money,
    })
  },
  showzhuxing: function (moneys) {
    var that = this;
    var systemInfo = app.systemInfo;
    var rate = systemInfo.screenWidth / 750;
    var updateData = {};
    updateData['columnCanvasData.fromColor'] = '#FDD883';
    updateData['columnCanvasData.toColor'] = '#FDB483';
    updateData['columnCanvasData.money'] = moneys;
    updateData['columnCanvasData.moneytype'] = '当前资金结余';

    var canvasWidth = systemInfo.screenWidth - rate * 64 - 20;
    var canvasHeight = rate * 306 + rate * 44 + rate * 34 + rate * 22;

    var culumnYMax = 60;
    var culumnYMin = 0;

    updateData['columnCanvasData.canvasWidth'] = canvasWidth;
    updateData['columnCanvasData.axisPadd'] = { left: rate * 5, top: rate * 13, right: rate * 5 };
    updateData['columnCanvasData.axisMargin'] = { bottom: rate * 34, left: rate * 26 };
    updateData['columnCanvasData.yAxis.fontSize'] = rate * 22;
    updateData['columnCanvasData.yAxis.fontColor'] = '#637280';
    updateData['columnCanvasData.yAxis.lineColor'] = '#DCE0E6';
    updateData['columnCanvasData.yAxis.lineWidth'] = rate * 2;
    updateData['columnCanvasData.yAxis.dataWidth'] = rate * 42;
    updateData['columnCanvasData.yAxis.isShow'] = true;
    updateData['columnCanvasData.yAxis.isDash'] = true;
    updateData['columnCanvasData.yAxis.minData'] = culumnYMin;
    updateData['columnCanvasData.yAxis.maxData'] = culumnYMax;
    updateData['columnCanvasData.yAxis.padd'] = rate * 306 / (culumnYMax - culumnYMin);

    updateData['columnCanvasData.xAxis.dataHeight'] = rate * 26;
    updateData['columnCanvasData.xAxis.fontSize'] = rate * 22;
    updateData['columnCanvasData.xAxis.fontColor'] = '#637280';
    updateData['columnCanvasData.xAxis.lineColor'] = '#DCE0E6';
    updateData['columnCanvasData.xAxis.lineWidth'] = rate * 2;
    updateData['columnCanvasData.xAxis.padd'] = rate * 52-7;
    updateData['columnCanvasData.xAxis.dataWidth'] = rate * 42;
    updateData['columnCanvasData.xAxis.leftOffset'] = rate * 40;


    updateData['columnCanvasData.canvasHeight'] = canvasHeight;
    updateData['columnCanvasData.enableScroll'] = true;

    that.setData(updateData);
  },
  showzhuxing2: function (montharr, ydata, datamonth) {
    var that = this;
    var updateData = {};

    var columnYMax = 60;
    var columnYMin = 0;
    updateData['columnCanvasData.yAxis.minData'] = columnYMin;
    updateData['columnCanvasData.yAxis.maxData'] = columnYMax;
    updateData['columnCanvasData.series'] = [{
      data: datamonth,
    }];
    updateData['columnCanvasData.xAxis.data'] = montharr;
    //  ['201711', '201712', '201801', '201802', '201803', '201804'];
    updateData['columnCanvasData.yAxis.data'] = ydata;
    //  [
    //   { x: 0, y: 0, title: '0' },
    //   { x: 0, y: 20, title: '20' },
    //   { x: 0, y: 40, title: '40' },
    //   { x: 0, y: 60, title: '60' }
    // ];

    that.setData(updateData);
  },
  showzhuxings: function (moneys) {
    var that = this;
    var systemInfo = app.systemInfo;
    var rate = systemInfo.screenWidth / 750;
    var updateData = {};
    // updateData['columnCanvasData2.fromColor'] = '#FDD883';
    // updateData['columnCanvasData2.toColor'] = '#FDB483';
    updateData['columnCanvasData2.money'] = moneys;
    updateData['columnCanvasData2.moneytype'] = '当前存货结余';
    var canvasWidth = systemInfo.screenWidth - rate * 64 - 20;
    var canvasHeight = rate * 306 + rate * 44 + rate * 34 + rate * 22;

    var culumnYMax = 60;
    var culumnYMin = 0;
    updateData['columnCanvasData2.canvasWidth'] = canvasWidth;
    updateData['columnCanvasData2.axisPadd'] = { left: rate * 5, top: rate * 13, right: rate * 5 };
    updateData['columnCanvasData2.axisMargin'] = { bottom: rate * 34, left: rate * 26 };
    updateData['columnCanvasData2.yAxis.fontSize'] = rate * 22;
    updateData['columnCanvasData2.yAxis.fontColor'] = '#637280';
    updateData['columnCanvasData2.yAxis.lineColor'] = '#DCE0E6';
    updateData['columnCanvasData2.yAxis.lineWidth'] = rate * 2;
    updateData['columnCanvasData2.yAxis.dataWidth'] = rate * 42;
    updateData['columnCanvasData2.yAxis.isShow'] = true;
    updateData['columnCanvasData2.yAxis.isDash'] = true;
    updateData['columnCanvasData2.yAxis.minData'] = culumnYMin;
    updateData['columnCanvasData2.yAxis.maxData'] = culumnYMax;
    updateData['columnCanvasData2.yAxis.padd'] = rate * 306 / (culumnYMax - culumnYMin);

    updateData['columnCanvasData2.xAxis.dataHeight'] = rate * 26;
    updateData['columnCanvasData2.xAxis.fontSize'] = rate * 22;
    updateData['columnCanvasData2.xAxis.fontColor'] = '#637280';
    updateData['columnCanvasData2.xAxis.lineColor'] = '#DCE0E6';
    updateData['columnCanvasData2.xAxis.lineWidth'] = rate * 2;
    updateData['columnCanvasData2.xAxis.padd'] = rate * 52 - 7;
    updateData['columnCanvasData2.xAxis.dataWidth'] = rate * 42;
    updateData['columnCanvasData2.xAxis.leftOffset'] = rate * 40;


    updateData['columnCanvasData2.canvasHeight'] = canvasHeight;
    updateData['columnCanvasData2.enableScroll'] = true;

    that.setData(updateData);
  },
  showzhuxings2: function (montharr, ydata, datamonth,moneys=0) {
    var that = this;
    var updateData = {};
    var columnYMax = 60;
    var columnYMin = 0;
    
    updateData['columnCanvasData2.yAxis.minData'] = columnYMin;
    updateData['columnCanvasData2.yAxis.maxData'] = columnYMax;
    updateData['columnCanvasData2.series'] = [{
      data: datamonth,
    }];
    updateData['columnCanvasData2.xAxis.data'] = montharr;
    updateData['columnCanvasData2.yAxis.data'] = ydata;
    that.setData(updateData);
  },
  // onTouchHandler(e) {
  //   if (null == this.column_chart) {
  //     this.column_chart = this.selectComponent("#column-chart");
  //   }
  //   this.column_chart.onTouchHandler(e);
  // },
  // onTouchMoveHandler(e) {
  //   if (null == this.column_chart) {
  //     this.column_chart = this.selectComponent("#column-chart");
  //   }
  //   this.column_chart.onTouchMoveHandler(e);
  // },
  // onTouchEndHandler(e) {
  //   if (null == this.column_chart) {
  //     this.ccolumn_chart = this.selectComponent("#column-chart");
  //   }
  //   this.column_chart.onTouchEndHandler(e);
  // },
})